const INITIAL_STATE = {
  userInfo: {},
}

export default function user(state = INITIAL_STATE, action) {
  switch (action.type) {
    case 'USER_INFO': {
      return {
        ...state,
        userInfo: {
          ...action.payload,
          login: true,
        },
      }
    }
    case 'USER_LOGIN': {
      return {...state}
    }
    default:
      return state
  }
}
